package com.ruoyi.member.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.member.mapper.FamilyMembersMapper;
import com.ruoyi.member.domain.FamilyMembers;
import com.ruoyi.member.service.IFamilyMembersService;

/**
 * 家庭信息人员Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-30
 */
@Service
public class FamilyMembersServiceImpl implements IFamilyMembersService 
{
    @Autowired
    private FamilyMembersMapper familyMembersMapper;

    /**
     * 查询家庭信息人员
     * 
     * @param id 家庭信息人员主键
     * @return 家庭信息人员
     */
    @Override
    public FamilyMembers selectFamilyMembersById(Long id)
    {
        return familyMembersMapper.selectFamilyMembersById(id);
    }

    /**
     * 查询家庭信息人员列表
     * 
     * @param familyMembers 家庭信息人员
     * @return 家庭信息人员
     */
    @Override
    public List<FamilyMembers> selectFamilyMembersList(FamilyMembers familyMembers)
    {
        return familyMembersMapper.selectFamilyMembersList(familyMembers);
    }

    /**
     * 新增家庭信息人员
     * 
     * @param familyMembers 家庭信息人员
     * @return 结果
     */
    @Override
    public int insertFamilyMembers(FamilyMembers familyMembers)
    {
        familyMembers.setCreateTime(DateUtils.getNowDate());
        return familyMembersMapper.insertFamilyMembers(familyMembers);
    }

    /**
     * 修改家庭信息人员
     * 
     * @param familyMembers 家庭信息人员
     * @return 结果
     */
    @Override
    public int updateFamilyMembers(FamilyMembers familyMembers)
    {
        familyMembers.setUpdateTime(DateUtils.getNowDate());
        return familyMembersMapper.updateFamilyMembers(familyMembers);
    }

    /**
     * 批量删除家庭信息人员
     * 
     * @param ids 需要删除的家庭信息人员主键
     * @return 结果
     */
    @Override
    public int deleteFamilyMembersByIds(Long[] ids)
    {
        return familyMembersMapper.deleteFamilyMembersByIds(ids);
    }

    /**
     * 删除家庭信息人员信息
     * 
     * @param id 家庭信息人员主键
     * @return 结果
     */
    @Override
    public int deleteFamilyMembersById(Long id)
    {
        return familyMembersMapper.deleteFamilyMembersById(id);
    }
}
